{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "initial_id",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Config:\n",
      "{\n",
      "    database: Datasets\n",
      "    rescale_size: 32\n",
      "    crop_size: 32\n",
      "    net: cnn\n",
      "    opt: adam\n",
      "    batch_size: 128\n",
      "    lr: 0.1\n",
      "    weight_decay: 1e-05\n",
      "    epochs: 200\n",
      "    resume: None\n",
      "    gpu: 0\n",
      "    use_fp16: True\n",
      "    log_freq: 200\n",
      "    log_prefix: josrc\n",
      "    eps: 0.6\n",
      "    warmup_epochs: 10\n",
      "    tau_clean: 0.75\n",
      "    alpha: 0.5\n",
      "    cfg_file: ./config/cifar.cfg\n",
      "    dataset: cifar10\n",
      "    r_id: 0.1\n",
      "    r_ood: 0.1\n",
      "    r_imb: 0.1\n",
      "    seed: 0\n",
      "    asym: False\n",
      "    n_classes: 10\n",
      "    log: cifar10-0.1-0.1-0.1\n",
      "}\n",
      "\n",
      "Available GPUs Index : 0\n",
      "\u001b[32m2024-08-25 12:29:24\u001b[0m - | \u001b[33mDEBUG\u001b[0m    | - \u001b[33mResult Path: ./log/cifar10-0.1-0.1-0.1\u001b[0m\n",
      "using CIFAR-10...\n",
      "Built imbalanced dataset, r_imb=0.1\n",
      "Mixing in OOD noise, r_ood=0.1\n",
      "Mixing in ID noise, r_id=0.1\n",
      "using CIFAR-10...\n",
      "\u001b[32m2024-08-25 12:29:28\u001b[0m - | \u001b[33mDEBUG\u001b[0m    | - \u001b[33mEpoch:[  1/200]  Lr:[0.10000]\u001b[0m\n",
      "\u001b[31mthreshold_clean: 0.00000\u001b[0m\n",
      "=================================================\n",
      "start the warm-up step for 10 epochs.\n",
      "=================================================\n",
      "\u001b[32m2024-08-25 12:29:32\u001b[0m - | \u001b[33mDEBUG\u001b[0m    | - \u001b[33mEpoch:[  1/200]  Iter:[ 160/ 160]  Train Accuracy:[ 29.30]  Loss:[4.7727]    0.02 sec/iter\u001b[0m\n",
      "100%|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| 625/625 [00:01<00:00, 509.46it/s]\n",
      "\u001b[32m2024-08-25 12:29:33\u001b[0m - | \u001b[34mINFO\u001b[0m     | - \u001b[34mepoch:   1 | train loss: 4.7727 | train accuracy: 29.304 | test accuracy: 23.240 | epoch runtime:   5.06 sec | best accuracy: 23.240 @ epoch: 001\u001b[0m\n",
      "\u001b[32m2024-08-25 12:29:33\u001b[0m - | \u001b[34mINFO\u001b[0m     | - \u001b[34mEvaluate Summary Acc@1 23.2400\u001b[0m\n",
      "\u001b[32m2024-08-25 12:29:34\u001b[0m - | \u001b[33mDEBUG\u001b[0m    | - \u001b[33mEpoch:[  2/200]  Lr:[0.09999]\u001b[0m\n",
      "\u001b[31mthreshold_clean: 0.07500\u001b[0m\n",
      "\u001b[32m2024-08-25 12:29:37\u001b[0m - | \u001b[33mDEBUG\u001b[0m    | - \u001b[33mEpoch:[  2/200]  Iter:[ 160/ 160]  Train Accuracy:[ 37.60]  Loss:[4.4906]    0.02 sec/iter\u001b[0m\n",
      "100%|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| 625/625 [00:01<00:00, 498.03it/s]\n",
      "\u001b[32m2024-08-25 12:29:38\u001b[0m - | \u001b[34mINFO\u001b[0m     | - \u001b[34mepoch:   2 | train loss: 4.4906 | train accuracy: 37.605 | test accuracy: 24.770 | epoch runtime:   3.85 sec | best accuracy: 24.770 @ epoch: 002\u001b[0m\n",
      "\u001b[32m2024-08-25 12:29:38\u001b[0m - | \u001b[34mINFO\u001b[0m     | - \u001b[34mEvaluate Summary Acc@1 24.7700\u001b[0m\n",
      "\u001b[32m2024-08-25 12:29:38\u001b[0m - | \u001b[33mDEBUG\u001b[0m    | - \u001b[33mEpoch:[  3/200]  Lr:[0.09998]\u001b[0m\n",
      "\u001b[31mthreshold_clean: 0.15000\u001b[0m\n",
      "\u001b[32m2024-08-25 12:29:41\u001b[0m - | \u001b[33mDEBUG\u001b[0m    | - \u001b[33mEpoch:[  3/200]  Iter:[ 160/ 160]  Train Accuracy:[ 40.89]  Loss:[4.4684]    0.02 sec/iter\u001b[0m\n",
      " 84%|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>          | 526/625 [00:01<00:00, 597.54it/s]"
     ]
    }
   ],
   "source": [
    "!python main.py\n",
    "# !python main.py --r_ood 0.2\n",
    "# !python main.py --r_ood 0.2 --r_id 0.2\n",
    "# !python main.py --r_ood 0.2 --r_id 0.2 --asym"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7ed77a42a9839068",
   "metadata": {},
   "outputs": [],
   "source": [
    "!python main.py --r_imb 0.01\n",
    "!python main.py --r_imb 0.01 --r_ood 0.2\n",
    "!python main.py --r_imb 0.01 --r_ood 0.2 --r_id 0.2\n",
    "!python main.py --r_imb 0.01 --r_ood 0.2 --r_id 0.2 --asym"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ebdcb07a7aebb35",
   "metadata": {},
   "outputs": [],
   "source": [
    "!python main.py --dataset cifar100\n",
    "!python main.py --dataset cifar100 --r_ood 0.2\n",
    "!python main.py --dataset cifar100 --r_ood 0.2 --r_id 0.2\n",
    "!python main.py --dataset cifar100 --r_ood 0.2 --r_id 0.2 --asym\n",
    "!python main.py --dataset cifar100 --r_imb 0.01\n",
    "!python main.py --dataset cifar100 --r_imb 0.01 --r_ood 0.2\n",
    "!python main.py --dataset cifar100 --r_imb 0.01 --r_ood 0.2 --r_id 0.2\n",
    "!python main.py --dataset cifar100 --r_imb 0.01 --r_ood 0.2 --r_id 0.2 --asym"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
